// 放置全局指令
import Vue from 'vue'
import store from '@/store'

Vue.directive('btn-auth', {
  inserted(el, binding) {
    const btnPerm = binding.value
    const permissions = store.state.user.userProfile.permissions
    if (permissions.includes('*:*:*')) return
    if (!permissions.includes(btnPerm)) {
      el.remove()
    }
  }
})
